<div class="relative">
	<?php
	$form = $this->beginWidget('PsActiveForm', array(
		'id' => 'ps-customField-form',
		'enableAjaxValidation' => false,
		'enableClientValidation' => true,
		'clientOptions' => array(
			'inputContainer' => 'tr',
			'validateOnSubmit' => true,
		),
		'htmlOptions' => array(
		)
			));
	?>
    <div class="form relative">
        <div class="section">
			<div class="block">
				<div class="table-block">
					<table class="form-table">					
						<tr>
							<th scope="row" width="120">
								<?php echo $form->labelEx($customField, 'name', array('label' => 'Field Name')); ?>
							</th>
							<td>
								<div>
									<?php echo $form->textField($customField, 'name', array('size' => 30)); ?>
									<?php echo $form->error($customField, 'name'); ?>
								</div>
							</td>
						</tr>
						<tr>
							<th scope="row" width="120">
								<?php echo $form->labelEx($customField, 'custom_field_type'); ?>
							</th>
							<td>
								<div>
									<?php
									echo $form->dropDownList($customField, 'custom_field_type', CustomFieldType::getListData(), array(
										'id' => 'selectFormat',
										'disabled' => $customField->isNewRecord === false
									));
									?>
									<?php echo $form->error($customField, 'custom_field_type'); ?>
								</div>
							</td>
						</tr>
						<tr>
							<th scope="row" width="120">
								<?php echo $form->labelEx($customField, 'custom_field_group_id', array('label' => 'Custom Field Group')); ?>
							</th>
							<td>
								<div>
									<?php echo $form->dropDownList($customField, 'custom_field_group_id', $customFieldGroups, array('prompt' => '')); ?>
									<?php echo $form->error($customField, 'custom_field_group_id'); ?>
								</div>
							</td>
						</tr>
						<tr>
							<th scope="row" width="160">Possible Values</th>
							<td>
								<?php echo $form->textArea($customField, 'possible_values', array('rows'=> 5, 'cols' => 50)); ?>
							</td>
						</tr>
						<tr>
							<th scope="row" width="90">
								<?php echo $form->labelEx($customField, 'min_length'); ?>
							</th>
							<td>
								<div class="form-table-block">
									<?php echo $form->textField($customField, 'min_length', array('size' => 4)); ?>
									<?php echo $form->error($customField, 'min_length'); ?>
								</div>
							</td>
						</tr>
						<tr>
							<th scope="row" width="90">
								<?php echo $form->labelEx($customField, 'max_length'); ?>
							</th>
							<td>
								<div class="form-table-block">
									<?php echo $form->textField($customField, 'max_length', array('size' => 4)); ?>
									<?php echo $form->error($customField, 'max_length'); ?>
								</div>
							</td>
						</tr>
						<tr>
							<th scope="row" width="90">
								<?php echo $form->labelEx($customField, 'pos', array('label' => 'Position')); ?>
							</th>
							<td>
								<div class="form-table-block">
									<?php echo $form->textField($customField, 'pos', array('size' => 4)); ?>
									<?php echo $form->error($customField, 'pos'); ?>
								</div>
							</td>
						</tr>

						<tr>
							<th scope="row" width="90">
								<?php echo $form->labelEx($customField, 'default_value'); ?>
							</th>
							<td>
								<div class="form-table-block">
									<?php echo $form->textField($customField, 'default_value', array('size' => 30)); ?>
									<?php echo $form->error($customField, 'default_value'); ?>
								</div>
							</td>
						</tr>
						<tbody style="display:none;">
							<tr>
								<th scope="row" width="90">
									<?php echo $form->labelEx($customField, 'is_required'); ?>
								</th>
								<td>
									<div class="form-table-block">
										<?php echo $form->checkbox($customField, 'is_required'); ?>
										<?php echo $form->error($customField, 'is_required'); ?>
									</div>
								</td>
							</tr>
							<tr>
								<th scope="row" width="90">
									<?php echo $form->labelEx($customField, 'editable'); ?>
								</th>
								<td>
									<div class="form-table-block">
										<?php echo $form->checkbox($customField, 'editable'); ?>
										<?php echo $form->error($customField, 'editable'); ?>
									</div>
								</td>
							</tr>
							<tr>
								<th scope="row" width="90">
									<?php echo $form->labelEx($customField, 'visible'); ?>
								</th>
								<td>
									<div class="form-table-block">
										<?php echo $form->checkbox($customField, 'visible'); ?>
										<?php echo $form->error($customField, 'visible'); ?>
									</div>
								</td>
							</tr>
							<tr>
								<th scope="row" width="90">
									<?php echo $form->labelEx($customField, 'multiple'); ?>
								</th>
								<td>
									<div class="form-table-block">
										<?php echo $form->checkbox($customField, 'multiple'); ?>
										<?php echo $form->error($customField, 'multiple'); ?>
									</div>
								</td>
							</tr>
						</tbody>

					</table>
				</div>
			</div>
        </div>

        <div class="form_buttons">
			<?php
			echo GxHtml::submitButton('Save', array('class' => 'link-button green no-margin', 'name' => ''));
			?>
            <a href="<?php echo $this->createUrl('customField/index', array('type' => $customFieldModel)); ?>" class="link-button no-margin">Cancel</a>
        </div>
    </div><!-- end form -->
	<?php $this->endWidget(); ?>
</div>